for (var i = 0; i < this._ul.children.length; i++) { var childLI = <HTMLLIElement>this._ul.children.item(i);
if (childLI.tagName === 'LI'
|| (childLI.tagName && childLI.tagName.toLowerCase() === 'li')) { var childNode = new Node(this.fullPath, childLI);
this._children.push(childNode);
read(): { [propertyName: string]: string; } { this._populatePropertyCache();
var result: { [propertyName: string]: string; } = {}; for (var k in this._propertyElementCache) if (this._propertyElementCache.hasOwnProperty(k)) { var elem = this._propertyElementCache[k];
result[k] = decodeFromInnerHTML(elem.textContent);
update(values: { [propertyName: string]: string; }): void { for (var propertyName in values) if (values.hasOwnProperty(propertyName)) { propertyName = propertyName || null;
var elem = this._propertyElementCache[propertyName];
elem = document.createElement('pre'); elem.className = 'data-teapo-property';
this._propertyElementCache[propertyName] = elem;
elem.textContent = encodeForInnerHTML(values[propertyName]);
getNode(path: string, createIfAbsent: boolean): Node { throw new Error('Node is not a directory.'); var name: string, restPath: string;
var slashPos = path.indexOf('/'); slashPos = path.indexOf('/'); name = path.slice(0, slashPos);
restPath = path.slice(slashPos + 1);
return this._getNodeCore(name, restPath, createIfAbsent);
private _populatePropertyCache() { if (this._propertyElementCache) return;
this._propertyElementCache = {}; for (var i = 0; i < this._li.children.length; i++) { var elem = <HTMLPreElement>this._li.children.item(i);
if (elem.tagName === 'PRE'
|| (elem.tagName !== 'UL' && elem.tagName && elem.tagName.toLowerCase() == 'pre')) { var propertyName = elem.getAttribute('data-teapo-property') || null; this._propertyElementCache[propertyName] = elem;